//
//  NoLoginView.m
//  BaseTdkc
//
//  Created by DavidHuang on 16/7/1.
//  Copyright © 2016年 黄栋炜. All rights reserved.
//

#import "NoLoginView.h"

@interface NoLoginView()
@property (nonatomic, strong)UILabel *titleLb;
@property (nonatomic, strong)UILabel *upContentLb;
@end


@implementation NoLoginView

-(instancetype)init{
    if (self = [super init]) {
        self.frame = CGRectMake(0, 0, screenW, screenH - pixelValue(100) - navHeight);
        [self addSubview:self.titleLb];
        [self addSubview:self.upContentLb];
        [self addSubview:self.loginBtn];
        [self layoutLocation];
    }
    return self;
}
- (UILabel *)titleLb {
    if (_titleLb == nil) {
        _titleLb = [[UILabel alloc] init];
        _titleLb.font = [UIFont fontSizeOneText];
        _titleLb.textColor = [UIColor colorOfOneTextColor];
        _titleLb.textAlignment = NSTextAlignmentCenter;
        _titleLb.text = @"您还没有登录";
    }
    return _titleLb;
}

- (UILabel *)upContentLb {
    if (_upContentLb == nil) {
        _upContentLb = [[UILabel alloc] init];
        _upContentLb.font = [UIFont fontSizeTwoText];
        _upContentLb.textColor = [UIColor colorOfTwoTextColor];
        _upContentLb.textAlignment = NSTextAlignmentCenter;
        _upContentLb.text = @"登陆后我们将保存您所关注的企业";
    }
    return _upContentLb;
}

- (UIButton *)loginBtn {
    if (_loginBtn == nil) {
        _loginBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [_loginBtn setTitle:@"登录" forState:UIControlStateNormal];
        _loginBtn.layer.cornerRadius = pixelValue(10);
        
        
    }
    return _loginBtn;
}
- (void)layoutLocation {
    WS(weakSelf)
    [self.titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(pixelValue(350));
        make.centerX.mas_equalTo(weakSelf);
        
        
    }];
    [self.upContentLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.titleLb.mas_bottom).offset(pixelValue(50));
        make.centerX.mas_equalTo(weakSelf);
    }];
    [self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.upContentLb.mas_bottom).offset(pixelValue(130));
        make.centerX.mas_equalTo(weakSelf.upContentLb);
        make.width.mas_equalTo(pixelValue(482));
        make.height.mas_equalTo(pixelValue(60));
    }];
}
@end
